home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-06 | 1.4 KB | 35 lines | [TEXT/GEOL] |
- Item 6277544 31-Oct-88 15:16
-
- From: BIANCHI1 Bianchi, Curt
-
- To: D2303 Cameo Sys, Dev, Erik Swan
-
- cc: MACAPP.TECH$ MACAPP Tech
-
- Sub: Response to How to close
-
- Hi Bruce,
-
- Re: Closing modeless dialogs-
-
- As someone mentioned, windows are normally closed by calling the window's
- CloseByUser method. You could call CloseByUser in the appropriate DoChoice to
- close the window in response to clicking a button. When CloseByUser returns,
- the window and its subviews are free'd but the methods are not. That means you
- can't refer to any of the fields or instance variables of any of the views
- after the CloseByUser call but the code will still execute and DoChoice will
- return to its caller etc. The important point is to not refer to any fields of
- objects that will have been free'd as a result of calling CloseByUser. (I
- haven't tried this myself so I can't state with certainty that whether MacApp
- will try to refer to fields of the free'd objects.)
-
- Another thing you may want to do is call the dialog view's CanDismiss method
- first, and call CloseByUser if CanDismiss returns true.
-
- I hope this helps. We'll try this ourselves, and perhaps implement a dialog of
- this type in DemoDialogs, to make sure we have a good solution in the future.
-
- Curt Bianchi
-
-
-